#include "threadCache.h"


static void* concurrentAlloc(size_t memory_size)  // 利用线程局部存储使得每个线程有独立的threadcathe
{
    if(PTLSthreadCache == nullptr)
    { 
        PTLSthreadCache = new ThreadCache;
        return PTLSthreadCache->Allocation(memory_size);
    }
    else
    {
        return PTLSthreadCache->Allocation(memory_size);
    }
}

static void DeConcurrentAlloc(void* ptr, size_t size)
{
    assert(ptr);
    PTLSthreadCache->Dealloction(ptr, size);
}